<?php
declare (strict_types = 1);

namespace app\api\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class CouponModel extends Model
{
    protected $table='ea_user_coupon';
    public static function getUserCoupon($user_id,$status){
       return self::where('user_id',$user_id)->with("coupon")->where('status',0)->select()->toArray();
    }
    public function coupon(){
        return $this->hasOne('CouponDsecModel','id','coupon_id');
    }
}
